import request from '@/utils/request'

// 更新所有店铺商品列表
export function syncItemAll(merchantId) {
  return request({
    url: '/store/item/sync/' + merchantId,
    method: 'get'
  })
}

// 更新店铺商品列表
export function syncSelect(publishTaskIds) {
  return request({
    url: '/store/publish/sync/' + publishTaskIds,
    method: 'get',
  })
}

// 查询商品发布列表
export function listPublish(query) {
  return request({
    url: '/store/publish/list',
    method: 'get',
    params: query
  })
}

// 添加折扣
export function addDiscount(publishTaskIds) {
  return request({
    url: '/store/discount/add/publish/' + publishTaskIds,
    method: 'get'
  })
}

// 添加折扣
export function addAllDiscount(merchantId) {
  return request({
    url: '/store/discount/alldiscount/' + merchantId,
    method: 'get'
  })
}

// 删除发布记录
export function delPublish(publishTaskIds) {
  return request({
    url: '/store/publish/' + publishTaskIds,
    method: 'delete'
  })
}

// 强制删除发布记录
export function forceDelPublish(publishTaskIds) {
  return request({
    url: '/store/publish/force/' + publishTaskIds,
    method: 'delete'
  })
}